#ifndef __MOTOR_CAR_H_
#define __MOTOR_CAR_H_

#include <stdio.h>
#include <string.h>
#include <Arduino.h>
#include <Wire.h>

enum OmniDirectionalCar {
  STOP, FORWARD, BACKWARD, LEFT, RIGHT, LEFT_ROTATE, RIGHT_ROTATE
};

#define Motor_L_A_PIN 25
#define Motor_L_B_PIN 26
#define Motor_R_A_PIN 27
#define Motor_R_B_PIN 14

#define PWM_CHANNEL_LA 0
#define PWM_CHANNEL_LB 1
#define PWM_CHANNEL_RA 2
#define PWM_CHANNEL_RB 3

#define PWM_FREQUENCY 1000
#define PWM_RESOLUTION 8

void Motor_init();
void setMotorDifferentialSpeed(uint16_t motor_pin_A, uint16_t motor_pin_B, int motor_speed, uint8_t channel_A, uint8_t channel_B);
void setCarMove(uint8_t Movement, int Speed);
int myabs(int a);
int myignore_speed(int speed);
int limin_speed(int speed, int max, int min);
void Set_speed(int speed_fb, int speed_lr);

#endif